<template>
  <div class="about">
    <img :src="list.url" alt="" />
    <header>
      <p>{{ list.name }}</p>
      <p>{{ list.price }}</p>
    </header>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      list: Object,
    };
  },
  mounted() {
    axios.get("data.json").then((res) => {
      this.list = res.data.find((item) => item.name == this.$route.query.id);
      console.log(this.list);
    });
  },
  methods: {},
  components: {},
};
</script>

<style lang="scss">
.about {
  img {
    width: 100%;
    height: 300px;
  }
}
header {
  width: 100%;
  height: 50px;
  background-color: skyblue;
}
</style>
